home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2002 November / SGI IRIX Base Documentation 2002 November.iso / usr / share / catman / p_man / cat3s / strfmon.z / strfmon
Encoding:
Text File  |  2002-10-03  |  9.4 KB  |  199 lines

  1.  
  2.  
  3.  
  4. ssssttttrrrrffffmmmmoooonnnn((((3333SSSS))))                                                        ssssttttrrrrffffmmmmoooonnnn((((3333SSSS))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      _ssss_tttt_rrrr_ffff_mmmm_oooo_nnnn - convert monetary value to string
  10.  
  11. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  12.      _####_iiii_nnnn_cccc_llll_uuuu_dddd_eeee _<<<<_mmmm_oooo_nnnn_eeee_tttt_aaaa_rrrr_yyyy_...._hhhh_>>>>
  13.  
  14.      _ssss_ssss_iiii_zzzz_eeee______tttt _ssss_tttt_rrrr_ffff_mmmm_oooo_nnnn_((((_cccc_oooo_nnnn_ssss_tttt _cccc_hhhh_aaaa_rrrr _****_ssss_,,,, _ssss_iiii_zzzz_eeee______tttt _mmmm_aaaa_xxxx_ssss_iiii_zzzz_eeee_,,,, _cccc_oooo_nnnn_ssss_tttt _cccc_hhhh_aaaa_rrrr _****_ffff_oooo_rrrr_mmmm_aaaa_tttt_,,,, _...._...._...._))))_;;;;
  15.  
  16. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  17.      _ssss_tttt_rrrr_ffff_mmmm_oooo_nnnn places characters into the array pointed to by _s as controlled by
  18.      the string pointed to by _f_o_r_m_a_t. No more than _m_a_x_s_i_z_e bytes are placed
  19.      into the array.
  20.  
  21.      The format is a character string that contains two types of objects:
  22.      plain characters, which are simply copied to the output stream, and
  23.      conversion specifications, each of which results in the fetching of zero
  24.      or more arguments which are converted and formatted. The results are
  25.      undefined if there are insufficient arguments for the format.  If the
  26.      format is exhausted while arguments remain, the excess arguments are
  27.      simply ignored.
  28.  
  29.      A conversion specification consists of the following sequence:
  30.  
  31.      _----_----   a _%%%% character
  32.  
  33.      _----_----   optional flags
  34.  
  35.      _----_----   optional field width
  36.  
  37.      _----_----   optional left precision
  38.  
  39.      _----_----   optional right precision
  40.  
  41.      _----_----   a required conversion character that determines the conversion to be
  42.           performed.
  43.  
  44.      FFFFllllaaaaggggssss
  45.  
  46.      One  or more of the following optional flags can be specified to control
  47.      the conversion:
  48.  
  49.      _====_ffff        An = followed by a single character _f which is used as the
  50.                numeric fill character.  The fill character must be
  51.                representable in a single byte in order to work with precision
  52.                and width counts.  The default numeric fill character is the
  53.                space character.  This flag does not affect field width filling
  54.                which always uses the space character.  This flag is ignored
  55.                unless a left precision (see below) is specified.
  56.  
  57.      _^^^^         Do not format the currency amount with grouping characters.
  58.                The default is to insert the grouping characters if defined for
  59.                the current locale.
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. ssssttttrrrrffffmmmmoooonnnn((((3333SSSS))))                                                        ssssttttrrrrffffmmmmoooonnnn((((3333SSSS))))
  71.  
  72.  
  73.  
  74.      _++++ _oooo_rrrr _((((    Specify the style of representing positive and negative
  75.                currency amounts. Only one of + or ( may be specified. If + is
  76.                specified, the locale's equivalent of + and - are used (for
  77.                example, in the U.S.A.: the empty string if positive and - if
  78.                negative).  If ( is specified, negative amounts are enclosed
  79.                within parentheses.  If neither flag is specified, the + style
  80.                is used.
  81.  
  82.      _!!!!         Suppress the currency symbol from the output conversion.
  83.  
  84.      _----         Specify the alignment.  If this flag is present all fields are
  85.                left-justified (padded to the right) rather than right-
  86.                justified.
  87.  
  88.      FFFFiiiieeeelllldddd WWWWiiiiddddtttthhhh
  89.  
  90.      _wwww    A decimal digit string _w specifying a minimum field width in bytes
  91.           in which the result of the conversion is right-justified (or left-
  92.           justified if the flag - is specified).  The default is 0.
  93.  
  94.      LLLLeeeefffftttt PPPPrrrreeeecccciiiissssiiiioooonnnn
  95.  
  96.      _####_nnnn   A # followed by a decimal digit string _n specifying a maximum number
  97.           of digits expected to be formatted to the left of the radix
  98.           character. This option can be used to keep the formatted output from
  99.           multiple calls to the _s_t_r_f_m_o_n aligned in the same columns. It can
  100.           also be used to fill unused positions with a special character as in
  101.           $***_1_2_3._4_5. This option causes an amount to be formatted as if it
  102.           has causes an amount to be formatted as if it has the number of
  103.           digits specified by _n. If more than _n digit positions are required,
  104.           this conversion specification is ignored.  Digit positions in excess
  105.           of those actually required are filled with the numeric fill
  106.           character (see the _====_ffff flag above).
  107.  
  108.      If grouping has not been suppressed with the _^^^^ flag, and it is defined
  109.      for the current locale, grouping separators are inserted before the fill
  110.      characters (if any) are added.  Grouping separators are not applied to
  111.      fill characters even if the fill character is a digit.
  112.  
  113.      To ensure alignment, any characters appearing before or after the number
  114.      in the formatted output such as currency or sign symbols are padded as
  115.      necessary with space characters to make their positive and negative
  116.      formats an equal length.
  117.  
  118.      RRRRiiiigggghhhhtttt PPPPrrrreeeecccciiiissssiiiioooonnnn
  119.  
  120.      ._p   A period followed by a decimal digit string _p specifying the number
  121.           of digits after the radix character. If the value of the right
  122.           precision _p is 0, no radix character appears.  If a right precision
  123.           is not included, a default specified by the current locale is used.
  124.           The amount being formatted is rounded to the specified number of
  125.           digits prior to formatting.
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. ssssttttrrrrffffmmmmoooonnnn((((3333SSSS))))                                                        ssssttttrrrrffffmmmmoooonnnn((((3333SSSS))))
  137.  
  138.  
  139.  
  140.      CCCCoooonnnnvvvveeeerrrrssssiiiioooonnnn CCCChhhhaaaarrrraaaacccctttteeeerrrrssss
  141.  
  142.      The conversion characters and their meanings are:
  143.  
  144.      _iiii    The ddddoooouuuubbbblllleeee argument is formatted according to the locale's
  145.           international currency format (for example, in the U.S.A.: _UUUU_SSSS_DDDD
  146.           _1111_,,,,_2222_3333_4444_...._5555_6666).
  147.  
  148.      _nnnn    The ddddoooouuuubbbblllleeee argument is formatted according to the locale's national
  149.           currency format (for example, in the U.S.A.: _$$$$_1111_,,,,_2222_3333_4444_...._5555_6666).
  150.  
  151.      _%%%%    Convert to a _%%%%; no argument is converted.  The entire conversion
  152.           specification must be _%%%%_%%%%.
  153.  
  154.      LLLLooooccccaaaalllleeee IIIInnnnffffoooorrrrmmmmaaaattttiiiioooonnnn
  155.  
  156.      The LC_MONETARY category of the program's locale affects the behaviour of
  157.      this function including the monetary radix character (which may be
  158.      different from the numeric radix character affected by the LC_NUMERIC
  159.      category), the grouping separator, the currency symbols and formats. The
  160.      international currency symbol should be conformant with the ISO 4217:
  161.      1987 standard.
  162.  
  163.      The monetary formatting information being unavailable in the POSIX
  164.      locale, the result is undefined.
  165.  
  166. RRRREEEETTTTUUUURRRRNNNN VVVVAAAALLLLUUUUEEEE
  167.      If the total number of resulting bytes including the terminating null
  168.      byte is not more than _m_a_x_s_i_z_e, _s_t_r_f_m_o_n returns the number of bytes placed
  169.      into the array pointed to by _s, not including the terminating null byte.
  170.      Otherwise, -1 is returned, the contents of the array are indeterminate,
  171.      and _e_r_r_n_o is set to indicate the error.
  172.  
  173. EEEERRRRRRRROOOORRRRSSSS
  174.      _s_t_r_f_m_o_n _w_i_l_l _f_a_i_l _i_f:
  175.  
  176.      _[[[[_EEEE_2222_BBBB_IIII_GGGG_]]]]   Conversion stopped due to lack of space in the buffer.
  177.  
  178. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  179.      _llll_oooo_cccc_aaaa_llll_eeee_cccc_oooo_nnnn_vvvv_((((_))))_....
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.                                                                         PPPPaaaaggggeeee 3333
  196.  
  197.  
  198.  
  199.